Skip to content

Fix/payment result nan#2314

Merged
Wei-Shaw merged 2 commits into
Wei-Shaw:mainfrom
dexcoder6:fix/payment-result-nan
May 11, 2026
Merged

Fix/payment result nan#2314
Wei-Shaw merged 2 commits into
Wei-Shaw:mainfrom
dexcoder6:fix/payment-result-nan

Conversation

@dexcoder6
Copy link
Copy Markdown
Contributor

  1. 修复支付成功页充值金额显示 NaN 。
  2. 修复管理端订单详情充值金额显示 NaN。

dexcoder6 and others added 2 commits May 9, 2026 13:45
后端 ent 模型 PaymentOrder.FeeRate 带 omitempty,fee_rate=0 的订单
在 JSON 序列化时该字段会被剔除。前端 baseAmount 计算用 `fee_rate <= 0`
判断走分支,但 `undefined <= 0` 为 false,因此进入除法分支得到 NaN。

将 fee_rate 通过 Number(...) || 0 归一化,使缺失字段等价于 0。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
与支付成功页同源问题:fee_rate=0 时后端 omitempty 剔除字段,前端
`fee_rate <= 0` 判断对 undefined 失效,进入除法分支得到 NaN。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

All contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@dexcoder6
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request May 9, 2026
@Wei-Shaw Wei-Shaw merged commit 8b0b507 into Wei-Shaw:main May 11, 2026
8 of 9 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants